package com.example.yupao.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * @Author hhf
 * @Date 2024/9/19
 * @Description
 */
public enum TeamStatusEnum {
    PUBLIC(0,"公开"),
    PRIVATE(1,"私密"),
    SECRET(2,"加密");

    TeamStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    /**
     * id -> enum
     * @param value
     * @return
     */
    public static TeamStatusEnum getEnumByValue(Integer value){
        if (value == null){
            return null;
        }
        for (TeamStatusEnum teamStatusEnum : TeamStatusEnum.values()) {
            if (teamStatusEnum.value == value){
                return teamStatusEnum;
            }
        }
        return null;
    }

    @EnumValue
    private int value;
    private String text;

    public int getValue() {
        return value;
    }

    public String getText() {
        return text;
    }
}
